package test6.testcases;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import test6.data.SearchData;
import test6.data.UserData;
import test6.publics.LoginUser;
import test6.publics.SearchUser;

public class SearchTestCase {
	private static final Class<?> UserData = null;
	private WebDriver driver;
	private String baseUrl;
	
	@BeforeMethod
	public void setUp() throws Exception {
		driver = new FirefoxDriver();
		baseUrl = "http://127.0.0.1:1080/WebTours/";
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
	}
	
	@Test(dataProviderClass=SearchData.class,dataProvider="search")
	public void testCase(String dxp,String axp,String ddata,String adata,String no) throws Exception {
		driver.get(baseUrl);
		LoginUser.login(driver,"jojo","bean");         //调用登录模块
		Thread.sleep(5000);
		
		SearchUser.search(driver, dxp, axp, ddata, adata, no);
		//LoginUser.logout(driver);		                   //调用退出模块
	}
	
	@AfterMethod
	public void tearDown() throws Exception {
		driver.quit();
	}


}
